{
  "properties" : { },
  "id" : "beda88e7e55548c8a061583cc5c14b99",
  "script" : null,
  "groupId" : "b49fd3aa7ab944ca938fd37f3364f0ba",
  "name" : "B2查询气象站实时天气情况时间段",
  "createTime" : null,
  "updateTime" : 1736735782197,
  "lock" : null,
  "createBy" : "admin",
  "updateBy" : "admin",
  "path" : "/wsstationweatherhis",
  "method" : "GET",
  "parameters" : [ {
    "name" : "stationkey",
    "value" : "101060210",
    "description" : "必须填写 站ID",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "btime",
    "value" : "2024-12-20T00:00:00",
    "description" : "开始时间",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "etime",
    "value" : "2025-01-14T00:00:00",
    "description" : "结束时间",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "page",
    "value" : "1",
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "size",
    "value" : "20",
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "hour",
    "value" : "10",
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "stationtype",
    "value" : null,
    "description" : "站点类型  1. 国家站  2. 区域站 3. 火险监测站(海康)  4:和风天气",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 0,\n    \"message\": \"success\",\n    \"data\": {\n        \"total\": 5,\n        \"list\": [\n            {\n                \"stationkey\": \"E3516\",\n                \"timebase\": \"2024-12-29T22:00:00.000+00:00\",\n                \"pres\": 945.1,\n                \"pres_sea\": 1013.1,\n                \"temp\": -13.8,\n                \"temp_max\": -13.8,\n                \"temp_min\": -15.2,\n                \"humi\": 86,\n                \"humi_min\": 0,\n                \"prec\": 0,\n                \"win_10_dir\": 43,\n                \"win_10_vel\": 1.6,\n                \"win_inst_dir\": 0,\n                \"win_inst_vel\": 2.5,\n                \"snow\": 999998,\n                \"wep_now\": 0,\n                \"month\": \"202412\",\n                \"wep_txt\": null,\n                \"time\": \"2024-12-30 06:00:00\"\n            },\n            {\n                \"stationkey\": \"E3516\",\n                \"timebase\": \"2024-12-26T22:00:00.000+00:00\",\n                \"pres\": 949.8,\n                \"pres_sea\": 1018.4,\n                \"temp\": -14.6,\n                \"temp_max\": -14.5,\n                \"temp_min\": -15.1,\n                \"humi\": 64,\n                \"humi_min\": 0,\n                \"prec\": 0,\n                \"win_10_dir\": 261,\n                \"win_10_vel\": 8.9,\n                \"win_inst_dir\": 0,\n                \"win_inst_vel\": 13,\n                \"snow\": 999998,\n                \"wep_now\": 0,\n                \"month\": \"202412\",\n                \"wep_txt\": null,\n                \"time\": \"2024-12-27 06:00:00\"\n            },\n            {\n                \"stationkey\": \"E3516\",\n                \"timebase\": \"2024-12-25T22:00:00.000+00:00\",\n                \"pres\": 951.5,\n                \"pres_sea\": 1019.3,\n                \"temp\": -15.8,\n                \"temp_max\": -14.8,\n                \"temp_min\": -16.2,\n                \"humi\": 76,\n                \"humi_min\": 0,\n                \"prec\": 0,\n                \"win_10_dir\": 282,\n                \"win_10_vel\": 4.8,\n                \"win_inst_dir\": 0,\n                \"win_inst_vel\": 5.8,\n                \"snow\": 999998,\n                \"wep_now\": 0,\n                \"month\": \"202412\",\n                \"wep_txt\": null,\n                \"time\": \"2024-12-26 06:00:00\"\n            },\n            {\n                \"stationkey\": \"E3516\",\n                \"timebase\": \"2024-12-22T22:00:00.000+00:00\",\n                \"pres\": 952.9,\n                \"pres_sea\": 1021.2,\n                \"temp\": -12.5,\n                \"temp_max\": -12.1,\n                \"temp_min\": -12.6,\n                \"humi\": 87,\n                \"humi_min\": 0,\n                \"prec\": 0,\n                \"win_10_dir\": 269,\n                \"win_10_vel\": 3.5,\n                \"win_inst_dir\": 0,\n                \"win_inst_vel\": 4.4,\n                \"snow\": 999998,\n                \"wep_now\": 0,\n                \"month\": \"202412\",\n                \"wep_txt\": null,\n                \"time\": \"2024-12-23 06:00:00\"\n            },\n            {\n                \"stationkey\": \"E3516\",\n                \"timebase\": \"2024-12-19T22:00:00.000+00:00\",\n                \"pres\": 952.1,\n                \"pres_sea\": 1021,\n                \"temp\": -16.9,\n                \"temp_max\": -16.9,\n                \"temp_min\": -17.7,\n                \"humi\": 88,\n                \"humi_min\": 0,\n                \"prec\": 0,\n                \"win_10_dir\": 60,\n                \"win_10_vel\": 0.8,\n                \"win_inst_dir\": 0,\n                \"win_inst_vel\": 1.2,\n                \"snow\": 999998,\n                \"wep_now\": 0,\n                \"month\": \"202412\",\n                \"wep_txt\": null,\n                \"time\": \"2024-12-20 06:00:00\"\n            }\n        ]\n    },\n    \"timestamp\": 1735880312287,\n    \"executeTime\": 12\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
/**
 *   查询历史
 *  @param   stationkey  查询指定站点编码
 */
var sql = """
    select  *,to_char(timebase, 'YYYY-MM-DD HH24:MI:SS') as time from ws_station_data   
    where 1 = 1 
     <if test="stationkey != null and stationkey != ''" > and stationKey = #{stationkey} </if>
     <if test="btime != null and btime != ''\" > and TO_TIMESTAMP(replace(#{btime},'T',' '), 'YYYY-MM-DD HH24:MI:SS') <= timeBase </if>
     <if test="etime != null and etime != ''\" > and TO_TIMESTAMP(replace(#{etime},'T',' '), 'YYYY-MM-DD HH24:MI:SS') >= timeBase </if>
     <if test="hour != null and hour != ''\" > and  EXTRACT(HOUR FROM timebase) = ${hour}  </if>
     order by timeBase  desc
"""

return db.page(sql);